/*
 * birs_sys.h
 *
 * Created: 25.01.2014 21:07:51
 *  Author: Vladislav
 */ 


#ifndef BIRS_SYS_H_
#define BIRS_SYS_H_
#include "includes.h"

#define MSG_BUF_LEN 120
#define NUM_MSG_BUF 2
#define CAN_MSG_BUF_LEN 20
#define KEYBOARD_POLL_TIMEOUT 5
#define SYS_MODE_FAULT 0
#define SYS_MODE_ALARM 1
#define SYS_MODE_FIRE  2
#define SYS_MODE_ARCH  3
#define SYS_MODE_EMPTY 4
#define NUM_ALARM_DETECTORS 6
#define NUM_ALARM_ZONES 4
#define SYS_ALG_MANUAL 0
#define SYS_ALG_AUTO   1

//#define SILENT_MODE
void birs_init(void);

typedef struct _System
{
	uint8_t mode;
	uint8_t msg_count;
	uint8_t fire_event_cnt;
	uint8_t fault_event_cnt;
	uint8_t alarm_event_cnt;
	uint8_t alg;
	bool ext_started;
	uint8_t ext_mode;
}System;

typedef struct
{
	bool detector[NUM_ALARM_DETECTORS];
	uint8_t dnum;
}AlarmZone;
#endif /* BIRS_SYS_H_ */